/*
 * Instruction3F.java
 *
 * Created on March 22, 2007, 9:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package moto9s12sim;

/**
 *
 * @author Fergus Earnshaw
 */
public class Instruction3F extends Instruction{
    
    /** Creates a new instance of Instruction3F */
    public Instruction3F() {
        this.strAssemblyCode = "SWI";
        this.bCodes = new byte[1];
        this.bCodes[0] = (byte)Integer.parseInt("3F",16);
    }
    
    public boolean excute(M9S12 cpu)
    {
        this.shAddr = cpu.PC.getRegister();
        cpu.PC.inc();
        
        //TO DO CODE INSTRUCTION
        
        //to do set flags
        //todo logic
        //cpu.CC.setX(true);
        //cpu.CC.setS(true);
        
        cpu.CC.setI(true);
        
        printInstruction(cpu);
        //I think the first invalid instruction should halt excution
        return true;
    }  
    
}
